import random
b=random.randint(1,100)
print(b)
c=5000
while c>=500:
    a = int(input("请输入一个数字："))
    if a >b:
        print("大了,金币:{}".format(c))
        c-=500
    elif a <b:
        c -= 500
        print("小了,金币:{}".format(c))
    elif a==b:
        c+=3000
        print("恭喜猜中，本轮幸运数字：",b,"金币：{}".format(c))
        break
else:
    print("金币不足")

